from selenium import webdriver

from time import sleep

driver = webdriver.Chrome()
driver.get(r'D:\BaiduNetdiskDownload\注册A.html')
driver.find_element('css selector', '#userA').send_keys('admin')
# 上面代码等价于 driver.find_element('css selector', "[id='userA']").send_keys('admin')
sleep(2)
driver.find_element('css selector', "input[id='passwordA']").send_keys('123456')
# 注意上面代码可以不用加元素名(标签名称)，这是和 xpath 方法很大的不同之处
sleep(2)
driver.find_element('css selector', '.telA').send_keys('13000000000')
# 上面代码等价于 driver.find_element('css selector', "[class='telA']").send_keys('13000000000')
sleep(2)
received = driver.find_element('css selector', 'span').text
print(received)
driver.find_element('css selector', "p input[id='emailA']").send_keys('123@qq.com')
sleep(3)
driver.quit()
